package blog.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import blog.entity.User;
import blog.mapper.UserMapper;
import blog.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Resource
	private UserMapper userMapper;
	

	/**
	 * 根据用户名或密码登录
	 */
	public User getUserByNameOrEmail(String str) {
		return userMapper.getUserByNameOrEmail(str); 
	}
	/**
	 * 添加用户
	 */
	public void add(User user) {
		userMapper.add(user);
	}
	/**
	 * 查询用户列表
	 */
	public List<User> ListUser() {
		
		return userMapper.ListUser();
		
	}
	
	
	public User getUserById(Integer userId) {
		
		return userMapper.getUserById(userId);
	}
	
}
